<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateStudyStageTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('study_stage', function (Blueprint $table) {
//            $table->comment('课题研究关联申报阶段表');
            $table->bigIncrements('id')->comment('主键ID');
            $table->bigInteger('activity_id')->comment('activity_info关联id');
            $table->boolean('stage')->default(false)->comment('所属阶段：1-申报阶段，2-立项阶段，3-中期阶段，4-结项阶段');
            $table->date('begin_date')->nullable()->comment('开始时间');
            $table->date('end_date')->nullable()->comment('结束时间');
            $table->boolean('status')->default(false)->comment('状态: 0-待提交，1-待审核，2-通过，3-已驳回');
            $table->string('comment', 255)->nullable()->comment('审核原因');
            $table->longText('resources')->nullable()->comment('材料');
            $table->bigInteger('checker')->nullable()->comment('审核人关联id');
            $table->dateTime('check_date')->nullable()->comment('审核时间');
            $table->dateTime('created_at')->nullable()->comment('添加时间');
            $table->dateTime('updated_at')->nullable()->comment('更新时间');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('study_stage');
    }
};
